<?php
/**
 * 站长后台管理中心
**/
$title='后台管理中心';
include './Head.php';
?>
<?php
$count1=$DB->query("SELECT count(*) from pay_check")->fetchColumn();
$count2=$DB->query("SELECT count(*) from pay_daili")->fetchColumn();
$count3=$DB->query("SELECT count(nums) from pay_daili where status='1'")->fetchColumn();
?>

<div class="col-sm-6 col-lg-3">
	<a href="javascript:void(0)" class="widget">
	<div class="widget-content widget-content-mini text-right clearfix">
		<div class="widget-icon pull-left themed-background">
			<i class="fa fa-list-ol text-light-op"></i>
		</div>
		<h2 class="widget-heading h3">
		<strong><span id="count1"><?php echo $count1?></span>个</strong>
		</h2>
		<span class="text-muted">授权总数</span>
	</div>
	</a>
</div>
<div class="col-sm-6 col-lg-3">
	<a href="javascript:void(0)" class="widget">
	<div class="widget-content widget-content-mini text-right clearfix">
		<div class="widget-icon pull-left themed-background-success">
			<i class="fa fa-first-order text-light-op"></i>
		</div>
		<h2 class="widget-heading h3 text-success">
		<strong><span id="count2"><?php echo $count2?></span>个</strong>
		</h2>
		<span class="text-muted">授权商总数</span>
	</div>
	</a>
</div>
<div class="col-sm-6 col-lg-3">
						<a href="javascript:void(0)" class="widget">
							<div
								class="widget-content widget-content-mini text-right clearfix">
								<div class="widget-icon pull-left themed-background-success">
									<i class="fa fa-cart-plus text-light-op"></i>
								</div>
	<h2 class="widget-heading h3 text-warning">
		<strong>+ <span id="count3"><?php echo ($count3)?></span></strong>
		</h2>
		<span class="text-muted">授权额度</span>
	</div>
	</a>
  			</div>
  <div class="col-sm-6 col-lg-3">
	<a href="javascript:void(0)" class="widget">
	<div class="widget-content widget-content-mini text-right clearfix">
		<div class="widget-icon pull-left themed-background-danger">
			<i class="fa fa-rmb text-light-op"></i>
		</div>
		<h2 class="widget-heading h3 text-danger">
		<strong>$ <span id="count4"></span></strong>
		</h2>
		<span class="text-muted">今日交易额</span>
	</div>
	</a>
</div>
<div class="col-sm-6 col-lg-8">
	<div class="widget">
		<div class="widget-content border-bottom">
跑分统计( Top：12 )
		</div>
          <table class="table table-bordered table-striped">
		    <thead><tr>
													<th>ID</th>
													<th>提交域名</th>
													<th>收款金额</th>
              										<th>回调状态</th>
              										<th>回调返回数据</th>
													<th>收款检测时间</th>
													</tr></thead>
            <tbody>
			<?php 
			$num = 12;//显示?天前的数据
$rs=$DB->query("SELECT * FROM pay_notify WHERE1 order by addtime desc limit {$num}");
while($res = $rs->fetch())
{
	echo '<tr>
	<td>'.$res['id'].'</td>
	<td>'.$res['url'].'</td>
	<td><b>￥ '.$res['money'].'</b></td>
	<td>'.notify_zt($res['status']).'</td>
	<td>'.$res['pay_msg'].'</td>
	<td>'.$res['addtime'].'</td>
	</tr>';
}
function notify_zt($status)//出码状态
{
	if($status==1)
		return '<font color=green>回调成功</font>';
	elseif($status==2)
		return '<font color=red>回调失败</font>';
	else
		return '<font color=red>暂未回调</font>';
}
 ?>
			
			</tbody>
          </table>
		</div>
	</div>
</div>
<div class="col-sm-4">
	<div class="widget">
		<div class="widget-content border-bottom">
			<span class="pull-right text-muted"><i class="fa fa-circle"></i></span>
快捷功能
</div>
<div class="widget-content border-bottom">
  <a href="./Check.php?my=add">添加授权</a>丨
  <a href="./Daili.php?my=add">添加代理</a>丨
  <a href="./Up.php?act=update">上传更新包</a>丨
  <a href="./Up.php?act=release">上传安装包</a>丨
  <a href="./Update.php">更新配置</a>
  <br><br>
  <a href="./BuyOrder.php">自助购买订单列表</a>丨
  <a href="./Set.php">自助购买支付通道配置</a>丨
  <br><br><a href="/INTLPay_load/INTLPay_load.php?name=INTLPAY&url=<?php $siteurl = ($_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].'/'; echo $conf['sitename'];?>&url=<?=$siteurl?>" class="btn btn-xs btn-info"><span class="am-icon-pencil-square-o">点此下载云端辅助软件[自动写入绑定配置]</span></a>
  <br><br>
  <a href="login.php?logout">退出登录</a>
	</ul>
  </div>
  </div>